<include file="Public:header" />

<div class="tools"> 
<div class="add"><span><a href="{:U('Content/editart_video',array(aid=>$aid))}">添加</a></span></div>
<div class="del"><span><span><a href="javascript:void(0);" onclick="del();">删除</a></span></div>
</div>
<div class="content">
<!-----------------------------------------内容开始--------------------------------------------------->
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabBox">
<input type="hidden" name="aid" value="{$aid}" />

<tr class="tabTitleMain">
    <td width="5%" class="selectAll"><a href="javascript:;" id="selall">全选</a></td>
    <td width="5%">ID号</td>
    <td width="6%">名称</td>
    <td width="10%">创建时间</td>
    <td width="10%">修改时间</td>
    <td width="10%">操作</td>
</tr>


<volist name='list' id='l'>
<tr class="tabTextMain" id="From_1" onmouseout="this.style.background='#FFFFFF';" onmouseover="this.style.background='#fbf435';">
  <td><input type="checkbox" name="ids" id="ids" value="{$l.id}"></td>
  <td>{$l.id}</td>
  <td>{$l.name}</td>
  <td>{$l.ctime|date='Y-m-d H:i:s',###}</td>
  <td>{$l.stime|date='Y-m-d H:i:s',###}</td>
  <td><a href="{:U('Content/editart_video',array(id=>$l[id],aid=>$l[aid]))}">修改</a>|<a href="javascript:;" onclick="del({$l.id});">删除</a></td>
</tr>
</volist>
  
</table> 
<!-----------------------------------------内容结束--------------------------------------------------->
</div>
<script type="text/javascript">   
$(function() {   
$("#selall").toggle(function() {   
     $("input[name='ids']").each(function() {   
     $(this).attr("checked", true); 
     });
},function(){
	 $("input[name='ids']").each(function() {   
     $(this).attr("checked", false); 
     }); 
});

});
function del(kid){
kid = kid ? kid : getChecked();
kid = kid.toString();
if(kid == ''){
	ui.error('你没有选择任何选项！');
	return false;
}
if(!confirm('删除后无法恢复，确定删除？'))
	return false;

$.post("{:U('Content/delart_video')}", {ids:kid}, function(v){
	if( v == 1 ){
		ui.success('删除成功！');
		location.reload("{:U('Content/art_video',array(aid=>$aid))}");
	}else{
		ui.error('删除失败！');
	}
});
} 

function getChecked() {
var gids = new Array();
$.each($('input:checked'), function(i, n){
	gids.push( $(n).val() );
});
return gids;
}
</script>

    

<include file="Public:footer" />
